#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <shadow.h>
#include <unistd.h>


int main(int argc,char **argv){
	char *input_pass;
	struct spwd *shdowline;
	char *crypted_pass;
	if(argc < 2)
	{
		exit(1);
	}

	input_pass = getpass("PassWord:");
	shdowline = getspnam(argv[1]);
	crypted_pass = crypt(input_pass, shadowline->sp_pwdp);
	if(strcmp(shadowline->sp_pwdp,crypted_pass) == 0){
		puts("ok!");
	}
	else
		puts("faile")

	exit(0);
}
